package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;
import com.itboye.mengwu.data.interfaces.IReport;
import com.itboye.mengwu.data.model.AddShopCartSuccessBean;
import com.itboye.mengwu.data.model.ReportModel;

public class ReportRepository extends BaseNetRepository implements
		IReport<ReportModel> {

	public static final String ReportAdd = "BY_CoreReport_report";

	public ReportRepository(ICompleteListener listener) {
		super(listener);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(ReportModel model) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<String>() {
		}.getType();
		String apiVer = "100";
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("uid", model.getUid());
		params.put("report_type", model.getReport_type());
		params.put("report_id", model.getReport_id());
		params.put("op_uid", model.getOp_uid());
		params.put("reason", model.getReason());
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(ReportAdd, apiVer, params, type)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void delete(ReportModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(ReportModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(ReportModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<ReportModel> query(ReportModel model) {
		// TODO Auto-generated method stub
		return null;
	}

}
